package com.daoeping.data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Usr_friend entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "usr_friend", catalog = "daoeping")
public class Usr_friend implements java.io.Serializable {

	// Fields

	private Integer id;
	private Usr_user usr_userByUserId;
	private Usr_user usr_userByFriendId;
	private Usr_friendgroup usr_friendgroup;
	private String usrFriendcol;

	// Constructors

	/** default constructor */
	public Usr_friend() {
	}

	/** minimal constructor */
	public Usr_friend(Usr_user usr_userByUserId, Usr_user usr_userByFriendId ) {
		this.usr_userByUserId = usr_userByUserId;
		this.usr_userByFriendId = usr_userByFriendId;
	}

	/** full constructor */
	public Usr_friend(Usr_user usr_userByUserId, Usr_user usr_userByFriendId,
			Usr_friendgroup usr_friendgroup, String usrFriendcol) {
		this.usr_userByUserId = usr_userByUserId;
		this.usr_userByFriendId = usr_userByFriendId;
		this.usr_friendgroup =  usr_friendgroup;
		this.usrFriendcol = usrFriendcol;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public Usr_user getUsr_userByUserId() {
		return this.usr_userByUserId;
	}

	public void setUsr_userByUserId(Usr_user usr_userByUserId) {
		this.usr_userByUserId = usr_userByUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "friend_id", nullable = true)
	public Usr_user getUsr_userByFriendId() {
		return this.usr_userByFriendId;
	}

	public void setUsr_userByFriendId(Usr_user usr_userByFriendId) {
		this.usr_userByFriendId = usr_userByFriendId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "group_id", nullable = true)
	public Usr_friendgroup getUsr_friendgroup() {
		return usr_friendgroup;
	}
	
	public void setUsr_friendgroup(Usr_friendgroup usr_friendgroup) {
		this.usr_friendgroup = usr_friendgroup;
	}

	@Column(name = "usr_friendcol", length = 45)
	public String getUsrFriendcol() {
		return this.usrFriendcol;
	}
	
	public void setUsrFriendcol(String usrFriendcol) {
		this.usrFriendcol = usrFriendcol;
	}
	

	
}